/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package isd.inventario.modelo;

import isd.general.modelo.GR_Moneda;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "sttlpr")
public class ST_ListaDePrecio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    //Codigo de lista de precios
    @Column(name = "STTLPR_CODLIS", nullable = false, length = 10)
    private String codlis;
    @Basic(optional = false)
    @Column(name = "STTLPR_DESCRP", nullable = false, length = 60)
    private String descrp;

    @JoinColumn(name = "STTLPR_CODCOF", referencedColumnName = "GRTCOF_CODCOF", nullable = false, insertable=false, updatable=false)
    @ManyToOne
    private GR_Moneda coeficienteDeDeuda;
    //Incluye impuestos
    @Basic(optional = false)
    @Column(name = "STTLPR_INCIMP", nullable = false)
    private char incimp;
    //Un solo precio por producto en la lista de precios
    @Basic(optional = false)
    @Column(name = "STTLPR_PREUNI", nullable = false)
    private char preuni;

    @JoinColumn(name = "STTLPR_COFDEU", referencedColumnName = "GRTCOF_CODCOF", nullable = false, insertable=false, updatable=false)
    @ManyToOne
    private GR_Moneda coeficienteDeRegistracion;

    //Precio maximo
    @Column(name = "STTLPR_PRMXPR", precision = 15, scale = 7)
    private BigDecimal prmxpr;
    //Precio minimo
    @Column(name = "STTLPR_PRMIPR", precision = 15, scale = 7)
    private BigDecimal prmipr;
    //Unidad de expresion
    @Column(name = "STTLPR_UNIEXP", length = 6)
    private String uniexp;
    @Column(name = "STTLPR_FECALT")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecalt;
    @Column(name = "STTLPR_DEBAJA")
    private Character debaja;

    @OneToMany(mappedBy = "listaDePrecio", fetch=FetchType.LAZY)
    private List<ST_PrecioProducto> precioProductos;

   
    public ST_ListaDePrecio() {
    }

    public ST_ListaDePrecio(String codlis) {
        this.codlis = codlis;
    }

    public ST_ListaDePrecio(String codlis, String descrp, char incimp, char preuni) {
        this.codlis = codlis;
        this.descrp = descrp;
        this.incimp = incimp;
        this.preuni = preuni;
    }

    public String getCodlis() {
        return codlis;
    }

    public void setCodlis(String codlis) {
        this.codlis = codlis;
    }

    public GR_Moneda getCoeficienteDeDeuda() {
        return coeficienteDeDeuda;
    }

    public void setCoeficienteDeDeuda(GR_Moneda coeficienteDeDeuda) {
        this.coeficienteDeDeuda = coeficienteDeDeuda;
    }

    public GR_Moneda getCoeficienteDeRegistracion() {
        return coeficienteDeRegistracion;
    }

    public void setCoeficienteDeRegistracion(GR_Moneda coeficienteDeRegistracion) {
        this.coeficienteDeRegistracion = coeficienteDeRegistracion;
    }

    public Character getDebaja() {
        return debaja;
    }

    public void setDebaja(Character debaja) {
        this.debaja = debaja;
    }

    public String getDescrp() {
        return descrp;
    }

    public void setDescrp(String descrp) {
        this.descrp = descrp;
    }

    public Date getFecalt() {
        return fecalt;
    }

    public void setFecalt(Date fecalt) {
        this.fecalt = fecalt;
    }

    public char getIncimp() {
        return incimp;
    }

    public void setIncimp(char incimp) {
        this.incimp = incimp;
    }

    public char getPreuni() {
        return preuni;
    }

    public void setPreuni(char preuni) {
        this.preuni = preuni;
    }

    public BigDecimal getPrmipr() {
        return prmipr;
    }

    public void setPrmipr(BigDecimal prmipr) {
        this.prmipr = prmipr;
    }

    public BigDecimal getPrmxpr() {
        return prmxpr;
    }

    public void setPrmxpr(BigDecimal prmxpr) {
        this.prmxpr = prmxpr;
    }

    public String getUniexp() {
        return uniexp;
    }

    public void setUniexp(String uniexp) {
        this.uniexp = uniexp;
    }

    public List<ST_PrecioProducto> getPrecioProductos() {
        return precioProductos;
    }

    public void setPrecioProductos(List<ST_PrecioProducto> precioProductos) {
        this.precioProductos = precioProductos;
    }


    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final ST_ListaDePrecio other = (ST_ListaDePrecio) obj;
        if ((this.codlis == null) ? (other.codlis != null) : !this.codlis.equals(other.codlis)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (this.codlis != null ? this.codlis.hashCode() : 0);
        return hash;
    }
    
    @Override
    public String toString() {
        return "tv.inventario.modelo.ListaDePrecio[sttlprCodlis=" + codlis + "]";
    }

}
